home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00227_Test Flash speak events.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.7 KB  |  64 lines

  1. property pCharCode, pSpr, pFrameCount
  2.  
  3. on beginSprite me
  4.   global gTestFlashIndex, gImplementedCharacters
  5.   pSpr = sprite(me.spriteNum)
  6.   if voidp(gTestFlashIndex) or (gTestFlashIndex > count(gImplementedCharacters)) then
  7.     gTestFlashIndex = 1
  8.   else
  9.     gTestFlashIndex = gTestFlashIndex + 1
  10.   end if
  11.   if gTestFlashIndex > count(gImplementedCharacters) then
  12.     put "Test complete"
  13.     halt()
  14.   else
  15.     pCharCode = getPropAt(gImplementedCharacters, gTestFlashIndex)
  16.     pSpr.member = member(pCharCode & ".swf")
  17.     updateStage()
  18.   end if
  19.   put "Testing speak and move_glass events for" && pCharCode && "(other event types not tested)"
  20.   pFrameCount = pSpr.member.frameCount
  21. end
  22.  
  23. on speak me, speakSounds
  24.   repeat with VOname in speakSounds
  25.     soundFile = VOpath(pCharCode, VOname)
  26.     if FileExists(soundFile) then
  27.       next repeat
  28.     end if
  29.     debugAlert("Missing sound file" && soundFile)
  30.   end repeat
  31.   if pSpr.frame = pFrameCount then
  32.     go("test database")
  33.   end if
  34. end
  35.  
  36. on nextGlassMember me, glassType, glassPosition
  37.   return pCharCode & "_" & glassType & "_" & glassPosition
  38. end
  39.  
  40. on nextHandMember me, glassPosition
  41.   return pCharCode & "_" & "hand" & "_" & glassPosition
  42. end
  43.  
  44. on move_glass me, glassPosition
  45.   if glassPosition = "Hide" then
  46.     nothing()
  47.   else
  48.     glassPosition = char 1 of glassPosition
  49.     repeat with glassType in ["bee", "coc", "sho", "old", "hib", "col"]
  50.       nextGlass = nextGlassMember(me, glassType, glassPosition)
  51.       if the number of member nextGlass < 1 then
  52.         put "Glass" && nextGlass && "is missing"
  53.       end if
  54.     end repeat
  55.     nextHand = nextHandMember(me, glassPosition)
  56.     if the number of member nextHand < 1 then
  57.       put "Hand" && nextHand && "is missing"
  58.     end if
  59.   end if
  60. end
  61.  
  62. on newRect
  63. end
  64.